﻿#include "editor/drawing/tool.h"
#include "editor/settings.h"
#include "texture.h"
#include "draw.h"

using namespace anip;
using namespace anip::editor;

void drawing::Tool::activate()
{
	if (isExclusive())
	{
		for (auto t : Globals::drawingTools)
			if (t->isActive()) t->deactivate();
	}
	_active = true;
	tellInspectorAddContent();
}

void drawing::Tool::deactivate()
{
	_active = false;
	tellInspectorRemoveContent();
}

PreloadedTexture drawing::PointerTool::icon("ui/arrow.png");
PreloadedTexture drawing::PointerTool::cursor("ui/arrow-cursor.png");

void drawing::PointerTool::drawGizmo(invec2 pos)
{
	Draw::texture(pos, *cursor.get());
}